package test1;

import java.util.ArrayList;

public class EmpManage {
    ArrayList al=null;
    public EmpManage(){
        al.contains()
        al=new ArrayList();
    }
    public void addEmployee(Employee emp)
    {
        al.add(emp);
    }
    public void showInfo(String No){
        for(int i=0;i<al.size();i++){
            Employee emp=(Employee)al.get(i);
            if(emp.getNo().equals(No)){
                System.out.println(No);
                System.out.println(emp.getName());
            }
        }
    }
    public void updateSal(String No,float newsal){
        for (int i=0;i<al.size();i++){
            Employee emp=(Employee)al.get(i);
            if(emp.getNo().equals(No)){
                emp.setSal(newsal);
            }
        }
    }
    public void delemp(String No){
        for (int i=0;i<al.size();i++){
            Employee emp=(Employee)al.get(i);
            if(emp.getNo().equals(No)){
                al.remove(i);
            }
        }
    }
}
